export default {
    state: {
        userlist: [],
        page: 1,
        size: 40,
        total: 0
    },
    getters: {
        getters_userlist(state) {
            return state.userlist;
        },
        getters_total(state) {
            return state.total;
        },
        getters_page(state) {
            return state.page;
        }
    },
    mutations: {
        mutations_userlist(state, payload) {
            state.userlist = payload;
        },
        mutations_total(state, payload) {
            state.total = payload;
        },
        mutations_page(state, payload) {
            state.page = payload;
        }
    },
    actions: {
        async actions_userlist(context, payload) {
            try {
                console.log('actions_userlist', context);
                console.log('actions_userlist', payload);
                // let data = {
                //     size: context.state.size,
                //     page: context.state.page
                // }
                // let res = await get_userlist(data)
                // if (res.code == 200) {
                //     if (res.list == null && context.state.page != 1) {
                //         context.commit("mutations_page", context.state.page - 1);
                //         context.dispatch("actions_userlist");
                //     } else {
                //         context.commit("mutations_userlist", res.list);
                //         context.commit("mutations_total", res.total);
                //     }
                // }
            } catch (err) {
                console.log(err)
            }
        }
    },
    namespaced: true
}